Multiplies all the itemsΒΆ
Multiplies all the items in a list.
def multiply_list(L):
tot = 1
for x in L:
tot *= x
return tot
# test
print(multiply_list([1, 2, -8])) # -16
def multiply_list(L):
tot = 1
for x in L:
tot *= x
return tot
# test
print(multiply_list([1, 2, -8])) # -16